/*
 * Contains all data related to an accommodation session
 */
package com.spartancoder.accommodation.beans;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;

/**
 *
 * @author andrei
 */
public class AccommodationSessionBean {

	private int sessionId;
	private String name;
	private Timestamp startDate,  endDate;

	public int getSessionId() {
		return sessionId;
	}

	public void setSessionId(int sessionId) {
		this.sessionId = sessionId;
	}

	public Timestamp getEndDate() {
		return endDate;
	}

	public void setEndDate(Timestamp endDate) {
		this.endDate = endDate;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Timestamp getStartDate() {
		return startDate;
	}

	public void setStartDate(Timestamp startDate) {
		this.startDate = startDate;
	}

	public void fill(ResultSet rs) throws SQLException {
		setSessionId(rs.getInt("session_id"));
		setName(rs.getString("name"));
		setStartDate(rs.getTimestamp("start_date"));
		setEndDate(rs.getTimestamp("end_date"));
	}
}
